package com.hodgepodge.commons.exception;

import com.hodgepodge.commons.enums.ResultCodeEnum;
import lombok.Getter;

/**
 * title ApiException
 * projectName colorful-blog
 * desc 自定义API异常
 *
 * @author jiangjian
 * @date 2021/6/1 17:45
 */
@Getter
public class ApiException extends RuntimeException {

    private static final long serialVersionUID = -2171984411266829018L;

    private ResultCodeEnum result;

    public ApiException(ResultCodeEnum result) {
        super(result.getMsg());
        this.result = result;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

}
